﻿<%@ Page Language="C#" MasterPageFile="~/Master/ListMasterPage.master" AutoEventWireup="true" Inherits="Common_SelectColumn" Title="Untitled Page" Codebehind="SelectColumn.aspx.cs" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  <script type="text/javascript">
        ///单选返回值
        function RetureItem(obj) {
        alert(1);
            try {
                window.opener.SetItemValue(obj);
            } catch (e)
            { alert(e.message); };
            window.close();
        }
        function SelectRadioButton(selectRadbtn) {
            var objs = document.all.ctl00_ContentPlaceHolder1_GridView1.getElementsByTagName("input");
            if (objs != null && objs.length > 0) {
                for (var i = 0; i < objs.length; i++) {
                    var obj = objs[i];
                    if (obj.type.toLowerCase() == 'radio') {
                        obj.checked = false;
                    }
                }
            }
            selectRadbtn.checked = true;
        }
    </script>
      <div class="search_bar">
        <div style="width: 100%;">
            <div>
                <div class="label_div">
                    栏目名称：
                </div>
                <div class="inner_div">
                    <asp:TextBox ID="txt_Name" MaxLength="50" CssClass="t_search" runat="server"></asp:TextBox>
                </div>
                
                <div class="search_btn_group">
                    <asp:Button ID="searchButton" runat="server" CssClass="btn_Button" OnClick="searchButton_Click"
                        Text="搜索" />
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
    </div>
        <div class="tab_box">
        <!-- GridVeiw -->
        <asp:GridView ID="GridView1" DataKeyNames="id" CssClass="grid_bd" BorderWidth="0"
            runat="server" AutoGenerateColumns="False" Width="100%" EmptyDataText="没有记录。"
            AllowPaging="True" PageSize="10" AllowSorting="True" OnSorting="GridView1_Sorting"
            OnSorted="GridView1_Sorted" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound">
            <RowStyle CssClass="grid_item" />
            <AlternatingRowStyle CssClass="grid_alt_item" />
            <HeaderStyle CssClass="" />
            <EmptyDataRowStyle CssClass="grid_empty" />
            <PagerSettings Visible="False" />
            <Columns>
                <asp:TemplateField HeaderText="选择" ItemStyle-HorizontalAlign="center" Visible="true" SortExpression="Id">
                    <HeaderStyle Width="40px" />
                    <ItemTemplate>
                        <asp:RadioButton ID="ra" runat="server" value='<%#Eval("id")%>' />
                    </ItemTemplate>
                </asp:TemplateField>
               
               <asp:TemplateField HeaderText="名称" ItemStyle-HorizontalAlign="center" Visible="true" SortExpression="Title">
                    <ItemTemplate>
                        <asp:Label ID="txt_Title" runat="server" Text='<%#Eval("Title")%>' newfield="Title" value='<%#Eval("Title")%>' />
                    </ItemTemplate>
                </asp:TemplateField>
               
            </Columns>
        </asp:GridView>
    </div>
    <div class="grid_ft">
        <div id="pagerDiv" runat="server">
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" HorizontalAlign="Left" OnPageChanging="AspNetPager1_PageChanging"
                PageSize="10" ShowPageIndex="True" UrlPageIndexName="img" UrlPaging="False" Width="100%"
                PagingButtonType="Text" ImagePath="../_@Images/Pager/" ButtonImageNameExtension="n"
                ButtonImageExtension=".gif" DisabledButtonImageNameExtension="g" PagingButtonSpacing="8px"
                ShowCustomInfoSection="Left" CustomInfoHTML="记录总数：%RecordCount% &nbsp;当前页：<font color='red'>%currentPageIndex%</font> &nbsp;总页数：%pageCount%"
                EnableTheming="True" CustomInfoSectionWidth="35%" FirstPageText="首页" LastPageText="末页"
                NextPageText="下一页" PrevPageText="上一页" AlwaysShow="True" SubmitButtonText="跳转"
                SubmitButtonClass="btn_clear">
            </webdiyer:AspNetPager>
        </div>
    </div>
    <div id="bottom" style="width: 99%; text-align: center; padding-top: 4px;">
        <asp:Button runat="server" ID="btnSave" CssClass="btn_Button" Text="确定" OnClick="btnSave_Click" />
        <input type="button" id="quit" value="取消" class="btn_Button" onclick="window.parent.cancel();" />
    </div>
</asp:Content>

